///////////////////////  comments  /////////////////

#ifndef __H_COMMANDTABLE_
#define __H_COMMANDTABLE_

#include <vector>
#include "definitions.h"
#include "command.h"
#include "combined.h"

/////////////////////////////// regular commands //////////////////////////////
// The Command Table
class CommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		CommandTable( void );
		~CommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static CommandTable& Instance( void );
};

// Our singleton _instance
inline CommandTable& CommandTable::Instance( void ) {
	static CommandTable _instance;
	return _instance;
}

/////////////////////////////// area edit commands //////////////////////////////
// The Area Edit Command Table
class aCommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		aCommandTable( void );
		~aCommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static aCommandTable& Instance( void );
};

// Our singleton _instance
inline aCommandTable& aCommandTable::Instance( void ) {
	static aCommandTable _instance;
	return _instance;
}

/////////////////////////////// mob edit commands //////////////////////////////
// The Mob Edit Command Table
class mCommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		mCommandTable( void );
		~mCommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static mCommandTable& Instance( void );
};

// Our singleton _instance
inline mCommandTable& mCommandTable::Instance( void ) {
	static mCommandTable _instance;
	return _instance;
}

/////////////////////////////// player edit commands //////////////////////////////
// The Player Edit Command Table
class pCommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		pCommandTable( void );
		~pCommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static pCommandTable& Instance( void );
};

// Our singleton _instance
inline pCommandTable& pCommandTable::Instance( void ) {
	static pCommandTable _instance;
	return _instance;
}

/////////////////////////////// room edit commands //////////////////////////////
// The Room Edit Command Table
class rCommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		rCommandTable( void );
		~rCommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static rCommandTable& Instance( void );
};

// Our singleton _instance
inline rCommandTable& rCommandTable::Instance( void ) {
	static rCommandTable _instance;
	return _instance;
}

/////////////////////////////// room edit commands //////////////////////////////
// The Text Editor Command Table
class tCommandTable {
	protected:
		// Data...
		std::vector< Command* > _commands;

		// Methods...
		void	add( Command* command );
		bool	loadCommands( void );

	public:
		// Constructors...
		tCommandTable( void );
		~tCommandTable( void );

		// Public accessor methods...
		std::vector< Command* >&	getCommands( void );

		// General methods...
		bool		execute( Character* character, const std::string& command );
		Command*	findCommand( Character* character, const std::string& command );

		// Statics...
		static tCommandTable& Instance( void );
};

// Our singleton _instance
inline tCommandTable& tCommandTable::Instance( void ) {
	static tCommandTable _instance;
	return _instance;
}



#endif // __H_COMMANDTABLE_
